<template>
  <div>
    <div class="footer">
      <div class="wrapper_1200">
        <ul class="acea-row row-around row-middle">
          <li class="acea-row row-middle">
            <div class="picture"><span class="iconfont icon-pinzhong"></span></div>
            <div>品种齐全，购物轻松</div>
          </li>
          <li class="acea-row row-middle">
            <div class="picture"><span class="iconfont icon-zhifa"></span></div>
            <div>多仓直发，极速配送</div>
          </li>
          <li class="acea-row row-middle">
            <div class="picture"><span class="iconfont icon-hanghuo"></span></div>
            <div>正品行货，精致服务</div>
          </li>
          <li class="acea-row row-middle">
            <div class="picture"><span class="iconfont icon-dijia"></span></div>
            <div>天天低价，畅选无忧</div>
          </li>
        </ul>
        <div class="recordNum">
          <div>
            <template v-for="(item, index) in companyInfo.copyright">
              <a :href="item.url" class="copyright" v-if="item.url !== '#'" target="_blank">
                <img v-if="item.img" :src="item.img" alt="">{{item.name}}
              </a>
              <span class="copyright" v-else><img v-if="item.img" :src="item.img" alt="">{{item.name}}{{item.name}}</span>
            </template>
          </div>
          <div v-if="version.status == -1" class="crmeb-copyright">{{ version.year }} <a :href="`${version.url}`" target="_blank">{{ version.url }}</a><a href="https://www.miit.gov.cn/" target="_blank">{{ version.beian_sn }}</a></div>
          <div v-else class="crmeb-copyright">{{ version.Copyright }}<a href="https://www.miit.gov.cn/" target="_blank">{{ version.beian_sn }}</a></div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
    export default {
      name: "footers",
      components: {},
      mixins: [],
      data(){
        return{
          companyInfo:{},
          codeUrl:'',
          iScode:false,
          version: {}
        }
      },
      head() {
        return {
          meta: [
            {
              hid:'keywords',name:'keywords',content:this.companyInfo.site_keywords
            },
            {
              hid:'description',name:'description',content:this.companyInfo.site_description
            },
          ]
        }
      },
      beforeMount(){
        this.getCompanyInfo();
        this.getVersion();
      },
      mounted(){

      },
      methods:{
        goTop(){
          (function n() {
            var t = document.documentElement.scrollTop || document.body.scrollTop;
            if (t > 0) {
              window.requestAnimationFrame(n);
              window.scrollTo(0, t - t / 5)
            }
          })()
        },
        goRecommend(){

        },
        wxCode(){
          this.iScode = true
        },
        wxCodeHide(){
          this.iScode = false
        },
        goCart(){
          this.$router.push({path:'/shopping_cart'});
        },
        getCompanyInfo(){
          this.$axios.get("/api/pc/config").then(res=>{
            this.companyInfo = res.data;
            this.$store.commit('logo', res.data.site_logo);
            this.$cookies.set('logo',res.data.site_logo);
            this.$store.commit('titles', res.data.site_name);
            this.$cookies.set('titles',res.data.site_name);
            this.$store.commit('qrCode', res.data.wechat_qrcode);
            this.$store.commit('consumerHotline', res.data.sys_phone);
            this.$cookies.set('consumerHotline',res.data.sys_phone);
            this.$store.commit('domainName', res.data.site_url);
            this.$cookies.set('domainName',res.data.site_url);
            this.$store.commit('openService', res.data.is_open_service);
            this.$cookies.set('openService', res.data.is_open_service);
            this.$store.commit('openSettled',res.data.mer_intention_open);
          })
        },
        getVersion(){
          this.$axios.get("/api/version").then(res=>{
            this.version = res.data;
          })
        }
      }
    }
</script>

<style scoped lang="scss">
  .footer{
    margin-top: 50px;
    background-color: #f2f2f2;
    ul{
      height: 104px;
      border-bottom: 1px solid #E2E2E2;
      li{
        .picture{
          width: 40px;
          height: 40px;
          border: 1px solid #707070;
          border-radius: 50%;
          text-align: center;
          line-height: 40px;
          margin-right: 14px;
          .iconfont{
            font-size: 23px;
            color: #707070;
          }
        }
      }
    }
    .recordNum{
      text-align: center;
      padding: 30px 0 48px 0;
      img{
        width: 14px;
        height: 14px;
        display: inline-block;
        margin-right: 1px;
        position: relative;
        top: 2px;
      }
      .address{
        margin-left: 40px;
      }
      .record{
        margin-top: 6px;
        .num{
          margin-left: 10px;
          &:hover{
            color: #E93323
          }
        }
      }
    }
    span.copyright{
        cursor: default;
    }
    .copyright{
        color: #999;
        &:after{
            content: '|';
            display: inline-block;
            color: #ccc;
            font-size: 16px;
            margin: 0 10px;
        }
        &:last-child{
            &:after{
                display: none;
            }
        }
    }

    .crmeb-copyright {
        padding: 10px 0;
        color: #999;

        a {
            color: #999;

            + a {
                margin-left: 10px;
            }
        }
    }
  }
</style>
